package net.shopxx.excel.util;


public class ExcelFileUtil {

	private static final String SET = "set";

	public ExcelFileUtil() {
	}

	public static void setProperty(Object t, String name, Object value) {
		String methodString = getMethodString(name, SET);
		try {
			t.getClass().getMethod(methodString, new Class[] { value.getClass() }).invoke(t, new Object[] { value });
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	private static String getMethodString(String name, String type) {
		return (new StringBuilder(String.valueOf(type))).append(name.substring(0, 1).toUpperCase()).append(name.substring(1)).toString();
	}
}
